def func1(n):
    result=0
    for i in range(1,n+1):
        t=1
        for j in range(1,i+1):
            t=t*j
        result +=t
    return result


print(func1(3))
